{*include file="template/admin_head.htm"*}
  <table width="100%" border="0" cellspacing="0" cellpadding="0" id="containtable" class="{*$cf_controller*}">
  <tr>
    <td valign="top" bgcolor="#FFFFFF">
    <div class="wrapper pr_8">
            {*if $cf_action=='add' || $cf_action=='edit'*}
            
            <script type="text/javascript">
                $(function(){
					call_uploader('#notice_file_button','#notice_file','file');
					{*if $row['notice_file']*}
					$("#notice_file_show").append(show_file_div("#notice_file_button","#notice_file","{*$row['notice_file']*}","{*$cf_module*}"));
					{*/if*}

                    $("#act_form").submit(function(){
                        if($("#notice_title").val()==''){
                            my_alert('请输入公告的标题','操作提示',"$('#notice_title').focus()");
                            return false;
                        }
						
						if($("#notice_content").val()==''){
                            my_alert('请输入公告內容','操作提示',"$('#notice_content').focus()");
                            return false;
                        }
                    });

						
					$(".notice_type").click(function(){
							var check_value = $("input[name=notice_type]:checked").val();
							if(check_value=='0'){
								$("#notice_dpt_all").attr("checked","checked");
								$(".notice_dpt").attr("checked","checked");
								$(".notice_dpt").attr('disabled',true);
								$("#notice_dpt_all").attr('disabled',true);
							}else{
								$("#notice_dpt_all").attr("checked",false);
								$(".notice_dpt").attr("checked",false);
								$(".notice_dpt").attr('disabled',false);
								$("#notice_dpt_all").attr('disabled',false);
								}
						});
						
					$("#notice_dpt_all").click(function(){
							//var check_value = $("#notice_dpt_all").val();
							//alert(check_value);
							if($("#notice_dpt_all").attr("checked")==true){
								$(".notice_dpt").attr("checked",false);
								//$(".notice_dpt").attr('disabled',true);
							}else{
								$(".notice_dpt").attr("checked",false);
								$(".notice_dpt").attr('disabled',false);
								}
						});
					$(".notice_dpt").click(function(){
							//var check_value = $("#notice_dpt_all").val();
							//alert(check_value);
							if($("#notice_dpt_all").attr("checked")==true){
								$("#notice_dpt_all").attr("checked",false);
								//$(".notice_dpt").attr('disabled',true);
							}
						});
					

                })
            </script>
            <div class="sbox">
                <form action="{*$form_action*}" method="post" enctype="multipart/form-data" name="act_form" id="act_form">
                    <input name="id" id="id" type="hidden" value="{*$row['notice_id']*}" />
                    <input name="act" id="act" type="hidden" value="{*$cf_action*}" />
                    <input name="dpt" id="dpt" type="hidden" value="{*$cf_dpt*}" />
                    <input name="oldphoto" id="oldphoto" type="hidden" value="{*$row['notice_file']*}" />
                     <div class="content_panel_title">
                      <div class="contentpanelleft"></div>
                          <div class="contentpanelcenter">
                              <span class="contentpanelcenter_font">公告/修改公告</span>
                              <span><a class="edit at" href="{*$cf_self_page*}?dpt={*$cf_dpt*}">公告管理</a></span>                          </div>
                          <div class="contentpanelrihgt"></div>
                      </div>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tbl tbl_nbr">
                        <tbody>
                            <tr>
                                <td width="15%" align="right" class="ltd">公告标题:</td>
                                <td width="85%" align="left"><input name="notice_title" type="text" id="notice_title" value="{*$row['notice_title']*}" size="40" maxlength="40" />
                              <span class="red">*</span>&nbsp;<label for="checkbox"></label></td>
                            </tr>
                            <tr>
                                <td class="ltd" align="right">信息類型:</td>
                                <td align="left">{*html_radios name=notice_type class=notice_type options=$cf_info_var['2'] checked=$row['notice_type']|default:'1'*}
                                <span class="red">*</span></td>
                            </tr>
                            <tr>
                              <td class="ltd" align="right">部門性質:</td>
                              <td align="left"><!--{*html_options name=notice_dpt id=notice_dpt options=$cf_info_var['1'] selected=$row['notice_dpt']|default:'0'*}-->
                              
                              <input name="notice_dpt_all" id="notice_dpt_all" type="checkbox" value="0" {*if $cf_action=='edit' && $row['notice_dpt'] == '0'*} checked="checked"{*/if*}/>所有部門
                              {*html_checkboxes name=notice_dpt class=notice_dpt options=$cf_info_var['3'] selected=$row['notice_dpt']*}
                              <span class="red">*</span></td>
                            </tr>
                            
                            <tr>
                                <td class="ltd" align="right">公告內容:</td>
                                <td align="left"><textarea name="notice_content" id="notice_content" cols="90" rows="4">{*$row['notice_content']*}</textarea>
                                <span class="red">*</span></td>
                            </tr>
                            <tr>
                              <td class="ltd" align="right">指定地址:</td>
                              <td align="left"><input name="notice_url" type="text" id="notice_url" value="{*$row['notice_url']*}" size="40" maxlength="80" /></td>
                            </tr>
                            <tr>
                                <td class="ltd" align="right">附件:</td>
                              <td align="left"><input type="text" name="notice_file" id="notice_file" value="{*$row['notice_file']*}" />
							  <span id='notice_file_show'><img style="cursor:pointer" id="notice_file_button" src="/public/images/admin/upload.jpg"  /></span>
							  </td>
                            </tr>
                            
                            <tr>
                                <td class="ltd" colspan="2" align="center"><input type="submit" name="Submit" class="myinput" value="提 交" />
                                    &nbsp;&nbsp;
                                    <input type="button" name="back" class="myinput" value="返 回" onclick="window.history.back()" /></td>
                            </tr>
                        </tbody>
                    </table>
                </form>
            </div>
            <br />
            {*else*}
            <script type="text/javascript">
                $(function(){
                    //move_effect("#move_part1 h3","mpart","active");
                    move_effect("#move_part1 h2","active",0,'',1);
                    $("#checkall").toggle(
                    function(){
                        select_all("idlist[]",true);
                    },
                    function(){
                        select_all("idlist[]",false);
                    }
                );
                    $("#list_form").submit(function(){
                        if(!count_select("idlist[]")){
                            my_alert('请选择id记录','Error');
                            return false;
                        };
                        if($("#alltype").val()==''){
                            my_alert('请选择操作方式','Error',"$('#alltype').focus()");
                            return false;
                        };
                        if(confirm('确定进行操作?')==false){
                            return false;
                        }
                        return true;
                    });
                });



            </script>

            <div class="pannel">
                <div class="pl"></div>
                <div class="pr"></div>
                <div class="pc1">
                    <form name="search_form" id="search_form" method="post" action="{*$cf_self_page*}">
                    <input name="dpt" id="dpt" type="hidden" value="{*$cf_dpt*}" />
                        <div class="pt">
                            
                            公告標題:<input type="text" class="tet" name="skey" id="skey" size="20" value="{*$skey*}"/>
                            &nbsp;
                            <!--信息類型:{*html_options name=stype id=stype options=$cf_info_var['2'] selected=$smarty['post'].stype*}-->
                            <input type="image" src="public/images/admin/icon_search_btn.gif" /></div>
                        <!--<div class="separate"></div>

			<div class="pt">
				<img src="public/images/admin/icon_search.gif" />
				<input type="text" class="tet" size="10" />
				<img src="public/images/admin/icon_search_btn.gif" />
				<b>站内</b><input type="radio" name="3" class="rdo" />
			</div>-->
                    </form>
                </div>
            </div>

           
            
            <div class="content_panel_title">
                    <div class="contentpanelleft"></div>
                    <div class="contentpanelcenter">
                        <span class="contentpanelcenter_font">公告管理</span>

                        <span><a class="edit at" href="{*$cf_self_path*}-act_add.htm?dpt={*$cf_dpt*}">添加公告</a></span>                    </div>
                    <div class="contentpanelrihgt"></div>
                </div>
                <!--<div class="tab-row" id="move_part1">
                <h2 id="" class="tab"><a href="javascript:void(0)">待办事宜</a></h2>
                <h2 id="" class="tab"><a href="javascript:void(0)">站内短信息</a></h2>
                <h2 id="" class="tab"><a href="javascript:void(0)">快捷标签</a></h2>
                <h2 id="" class="tab"><a href="javascript:void(0)">帮助信息</a></h2>
                <div class="tab-page" style="display: block;">aaa</div>
                <div class="tab-page" style="display: none;">bbbb</div>
                <div class="tab-page" style="display: none;">ccc</div>
                <div class="tab-page" style="display: none;">ddd</div>
                </div>-->
                <div class="content_table_center_style">
                    <div class="p8">
                <form name="list_form" id="list_form" method="post" action="{*$cf_self_page*}">
                    <input name="act" type="hidden" value="all" />
                    <input name="dpt" id="dpt" type="hidden" value="{*$cf_dpt*}" />
                    <table width="100%" class="tbl tbl_nbr">
                        <thead>
                            <tr class="thd">
                                <td width="10%" align="center">选择</td>
                                <td width="6%" align="center" class="thr">ID</td>
                                <td width="25%" align="center" class="thr">标题</td>
                                <td width="11%" align="center" class="thr">部門性質</td>
                                <td width="9%" align="center" class="thr">信息類型</td>
                                <td width="8%" align="center" class="thr">發佈人</td>
                                <td width="14%" align="center" class="thr">發佈時間</td>
                                <td colspan="3" align="center" class="thr">操作</td>
                            </tr>
                        </thead>
                        <tbody>
                            {*foreach $data_ary as $item*}

                            <tr onmouseover="this.style.backgroundColor='#ffC'" onmouseout="this.style.backgroundColor='#ffF'">
                                <td align="center"><input type="checkbox" name="idlist[]" value="{*$item['notice_id']*}" style="height:15px;" /></td>
                                <td align="center">{*$item['notice_id']*}</td>
                                <td align="left">{*if $item['notice_dpt_type'] == '1'*}<img src="public/images/admin/you.png" align="middle" title="附件"/>{*/if*}<a href="javascript:void(0)" title="查看詳情" onclick="$(function(){my_iframe('{*$cf_self_path*}-act_detail.htm?id={*$item['notice_id']*}','查看詳情-{*$item['notice_title']*}',600,400)})" class="blue">{*$item['notice_title']*}</a>&nbsp;{*if $item['notice_file']*}<img src="public/images/admin/{*$item['thumb']*}.gif" align="middle" title="附件" />{*/if*}</td>
                            	<td align="center">{*if strstr($item['notice_dpt'],',')*}多個部門{*else*}{*$cf_info_var['1'][$item['notice_dpt']]*}{*/if*}</td>
                                <td align="center">{*$cf_info_var['2'][$item['notice_type']]*}</td>
                                <td align="center">{*$item['notice_creator']*}</td>
                                <td align="center">{*$item['notice_create_time']*}</td>
                                <td width="5%" align="center"><a href="javascript:void(0)" title="查看詳情" onclick="$(function(){my_iframe('{*$cf_self_path*}-act_detail.htm?id={*$item['notice_id']*}','查看詳情-{*$item['notice_title']*}',600,400)})" class="edit">詳情</a></td>
                                <td width="6%" align="center"><a href="{*$cf_self_path*}-act_edit_id_{*$item['notice_id']*}.htm?dpt={*$cf_dpt*}" class="edit">修改</a></td>
                                <td width="6%" align="center"><a href="{*$cf_self_path*}-act_del_id_{*$item['notice_id']*}.htm" class="del" onclick="return confirm('你确定要删除吗?')">删除</a></td>
                            </tr>
                            {*/foreach*}

                            <tr class="tft">
                                <td colspan="11" style="padding:0;">
                                    <table width="100%" border="0">
                                        <tr>
                                            <td width="6%" align="center" style="border:0;padding:0;"><input type="button" name="checkall" id="checkall" class="myinput" value="全 选" /></td>
                                            <td width="22%" align="center" style="border:0;padding:0;">
                                            <select name="alltype" id="alltype">
                                                    <option selected="selected" value="">操作选择</option>
                                                    <option value="alldel">删除</option>
                                                </select>
                                                &nbsp;<input type="submit" name="submit_all" id="submit_all" value="批量操作" class="myinput" /></td>
                                            <td width="72%" style="border:0;padding:0;" ><div class="turnPage"><p>{*$page*}</p></div></td>
                                        </tr>
                                    </table>                                </td>
                            </tr>
                        </tbody>
                    </table>
                </form>
                </div>
                </div>
               <div class="content_main_bottom">
                    <div class="content_main_bottom_left"></div>
                    <div class="content_main_bottom_right"></div>
                </div>
            </div>
            <br />
            {*/if*}

        </div>    </td>
    </tr>
</table>
{*include file="template/admin_foot.htm"*}